package com.ruoyi.order.domain;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单项对象 ver_order_item
 * 
 * @author ruoyi
 * @date 2025-08-21
 */
public class VerOrderItem extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单项ID（主键） */
    private Long id;

    /** 所属订单号（外键，关联 order 表） */
    @Excel(name = "所属订单号", readConverterExp = "外=键，关联,o=rder,表=")
    private Long orderId;

    /** 商品 SKU ID（外键，关联 product_sku 表） */
    @Excel(name = "商品 SKU ID", readConverterExp = "外=键，关联,p=roduct_sku,表=")
    private Long skuId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 购买时单价 */
    @Excel(name = "购买时单价")
    private BigDecimal unitPrice;

    /** 该订单项总金额（数量 × 单价） */
    @Excel(name = "该订单项总金额", readConverterExp = "数=量,×=,单=价")
    private BigDecimal totalPrice;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }
    public void setSkuId(Long skuId) 
    {
        this.skuId = skuId;
    }

    public Long getSkuId() 
    {
        return skuId;
    }
    public void setQuantity(Long quantity) 
    {
        this.quantity = quantity;
    }

    public Long getQuantity() 
    {
        return quantity;
    }
    public void setUnitPrice(BigDecimal unitPrice) 
    {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() 
    {
        return unitPrice;
    }
    public void setTotalPrice(BigDecimal totalPrice) 
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice() 
    {
        return totalPrice;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderId", getOrderId())
            .append("skuId", getSkuId())
            .append("quantity", getQuantity())
            .append("unitPrice", getUnitPrice())
            .append("totalPrice", getTotalPrice())
            .toString();
    }
}
